
import Color from 'color'
export function setColor(color){
    const el = document.documentElement
    el.style.setProperty('--el-color-primary', color.value)
    el.style.setProperty('--el-color-primary-dark-2', color.value)
    el.style.setProperty('--el--bg-color', color.value)
    for (let i = 1; i < 10; i++) {
      el.style.setProperty(
        `--el-color-primary-light-${i}`,
        Color(color.value).alpha(`${(1 - i * 0.1).toFixed(1)}`)
      )
    }
}